# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-store
pkgver=1.2.4
pkgrel=2
pkgdesc='Third party app store for DDE built with DTK'
arch=('loong64' 'x86_64')
url="https://github.com/dekzi/dde-store"
license=('GPL3')
depends=('appstream-qt5' 'archlinux-appstream-data' 'dtkwidget' 'packagekit-qt5')
makedepends=('cmake' 'ninja' 'qt5-tools')
source=("https://github.com/dekzi/dde-store/archive/$pkgver/$pkgname-$pkgver.tar.gz"
         appstream-1.0.patch)
sha512sums=('5a75f7d05a0020217efc56a2324c0210f812e531ca57ad952ce5bf7109dea5cace61ab2204f71ee292666422cccc53d61079a6b741e82c6e8d43fc6ed945fe15'
            'cccb0b827c073a7732bbeab2b8a8e840d57aea60eb8d5445fe329fdc7c5049c4e34ba4d2ca06035fe8e38786c95827574a71ab9b0e2e1a3dc68b92e0dfb2b646')

prepare() {
  cd dde-store-$pkgver
# Support appstream 1.0
  patch -p1 -i ../appstream-1.0.patch
}

build() {
  cd dde-store-$pkgver
  cmake -GNinja .
  ninja
}

package() {
  cd dde-store-$pkgver
  DESTDIR="$pkgdir" ninja install
}
